/**
 * 
 */
package com.neal.web.controller;

import javax.servlet.http.HttpServletResponse;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;
import com.neal.utils.WebUtils;
import com.neal.web.view.DownloadExcelView;
import com.neal.web.view.DownloadPdfView;


/**
 * @author Neal
 * @version 1.0
 * @description 
 */
@Controller
@RequestMapping("/download")
public class DownLoadController {
	
	@RequestMapping("excel")
	public ModelAndView excelDownLoad(@RequestParam String fileName,HttpServletResponse response){
		WebUtils.setDownLoadFileName(response, fileName);
		return new ModelAndView(new DownloadExcelView(),"fileName",fileName);
	}
	
	@RequestMapping("pdf")
	public ModelAndView pdfDownLoad(@RequestParam String fileName,HttpServletResponse response){
		WebUtils.setDownLoadFileName(response, fileName);
		return new ModelAndView(new DownloadPdfView(),"fileName",fileName);
	}
}
